package com.menxin.stack;

import java.util.Random;
import java.util.stream.IntStream;

/**
 * Created by Menx on 2019/3/7.
 */
public class Main {

    public static void main(String[] args){
        ArrayStack<Integer> arrayStack = new ArrayStack<>();
        int count = 20;
        for(int i = 0;i < count;i ++){
            arrayStack.push(i);
            System.out.println(arrayStack);
        }
        IntStream.range(0, 10).forEach(x -> arrayStack.pop());
        System.out.println(arrayStack);
        LinkedStack<Integer> linkedStack = new LinkedStack<>();
        count = 20;
        for(int i = 0;i < count;i ++){
            linkedStack.push(i);
            System.out.println(linkedStack);
        }
        IntStream.range(0, 10).forEach(x -> linkedStack.pop());
        System.out.println(linkedStack);

    }
}
